module MicroConference
  module MicroConferencesController
    # GET /micro_conferences
    # GET /micro_conferences.xml
    def index
      @micro_conferences = MicroConference.find(:all)
      
      respond_to do |format|
        format.html # index.html.erb
        format.xml  { render :xml => @micro_conferences }
      end
    end
    
    # GET /micro_conferences/1
    # GET /micro_conferences/1.xml
    def show
      @micro_conference = MicroConference.find(params[:id])
      
      respond_to do |format|
        format.html # show.html.erb
        format.xml  { render :xml => @micro_conference }
      end
    end
    
    # GET /micro_conferences/new
    # GET /micro_conferences/new.xml
    def new
      @micro_conference = MicroConference.new
      
      respond_to do |format|
        format.html # new.html.erb
        format.xml  { render :xml => @micro_conference }
      end
    end
    
    # GET /micro_conferences/1/edit
    def edit
      @micro_conference = MicroConference.find(params[:id])
    end
    
    # POST /micro_conferences
    # POST /micro_conferences.xml
    def create
      @micro_conference = MicroConference.new(params[:micro_conference])
      
      respond_to do |format|
        if @micro_conference.save
          flash[:notice] = 'MicroConference was successfully created.'
          format.html { redirect_to(@micro_conference) }
          format.xml  { render :xml => @micro_conference, :status => :created, :location => @micro_conference }
        else
          format.html { render :action => "new" }
          format.xml  { render :xml => @micro_conference.errors, :status => :unprocessable_entity }
        end
      end
    end
    
    # PUT /micro_conferences/1
    # PUT /micro_conferences/1.xml
    def update
      @micro_conference = MicroConference.find(params[:id])
      
      respond_to do |format|
        if @micro_conference.update_attributes(params[:micro_conference])
          flash[:notice] = 'MicroConference was successfully updated.'
          format.html { redirect_to(@micro_conference) }
          format.xml  { head :ok }
        else
          format.html { render :action => "edit" }
          format.xml  { render :xml => @micro_conference.errors, :status => :unprocessable_entity }
        end
      end
    end
    
    # DELETE /micro_conferences/1
    # DELETE /micro_conferences/1.xml
    def destroy
      @micro_conference = MicroConference.find(params[:id])
      @micro_conference.destroy
      
      respond_to do |format|
        format.html { redirect_to(micro_conferences_url) }
        format.xml  { head :ok }
      end
    end
  end
end